﻿using ReflectionStudio.Core.Events;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
namespace WPFExcelReport
{
    public partial class VGABEW
    {
        public readonly static VGABEW Instance = new VGABEW();
        string LastOrder = "";

        private DataTable _TBGB = null;
        public DataTable TBGB { get { return _TBGB; } set { _TBGB = value; OnPropertyChanged("TBGB", value); } } //lENGth 2
        public int LFDNR = 1;
        private string _BELEG = "0";
        public string BELEG { get { return _BELEG; } set { _BELEG = value; OnPropertyChanged("BELEG", value); } } //lENGth 2
        private DataTable _TBWB = null;
        private string _PARTIE = "0000000";
        public string PARTIE { get { return _PARTIE; } set { _PARTIE = value; OnPropertyChanged("PARTIE", value); } } //lENGth 2
        VEKPOS _VEKP;
        public VEKPOS VEKP
        {
            get
            {
                if (_VEKP == null)
                    _VEKP = new VEKPOS();
                return _VEKP;
            }
        }
        VGPBST _VGPB;
        public VGPBST VGPB
        {
            get
            {
                if (_VGPB == null)
                    _VGPB = new VGPBST();
                return _VGPB;
            }
        }
        VGPDAT _VGPD;
        public VGPDAT VGPD
        {
            get
            {
                if (_VGPD == null)
                    _VGPD = new VGPDAT();
                return _VGPD;
            }
        }
        VGLLG _VGL;
        public VGLLG VGL
        {
            get
            {
                if (_VGL == null)
                    _VGL = new VGLLG();
                return _VGL;
            }
        }

        public void NWBBEW(DataRow dwZU, string BEWBS, string _RUNID)
        {
            int BBLFDNR = 1;
            string BBBELEG = "";
            DataRow dwData;

            if (dwZU == null)
                return;
            dwData = TBMain.NewRow();
            SetUpNewRow(ref dwData);
            string _time = "";
            string _date = "";
            Helpers.Helper.GetTime(ref _date, ref _time);
            if (BEWBS == "61" || BEWBS == "62")
            {

                string order = dwZU["ZUAUFKRS"].ToString() + dwZU["ZUAUFLFD"].ToString();
                if (LastOrder == order)
                {
                    LFDNR = LFDNR + 1;
                    //BBLFDNR++;
                    BBBELEG = BELEG;
                    BBLFDNR = LFDNR;
                }
                else
                {
                    LastOrder = order;
                    BBBELEG = VSDDAT.SD22.GETNEXT("0022", "  ", "BEWEGUNG", 2);
                    BBLFDNR = 1;
                    LFDNR = BBLFDNR;
                    BELEG = BBBELEG;
                }

            }
            PM["ZUTEI"] = dwZU;
            PM["BELEG"] = BBBELEG;
            PM["LFDNR"] = BBLFDNR;
            PM["BEWBS"] = BEWBS;
            PM["RUNID"] = _RUNID;

            NWBBEW(dwData, PM, true);
        }
        public void NWBBEW(DataRow dwNGBW, Dictionary<string, object> pm, bool IsInsert = false)
        {

            FIXDATA(dwNGBW, pm);
            if (IsInsert)
            {
                InsertGABEW(dwNGBW, app.company);
            }
            else
            {
                BATCHWB14(dwNGBW);
            }
        }

        public MessageInfo NWBBEWVK(DataRow dwZU, string BEWBS, string _RUNID)
        {
            NWBBEW(dwZU, BEWBS, RUNID);
            return null;
        }

        public void NEWEKGB(DataRow dwEKP, string TLO, string TLB, string TLP, double BOX, double QTY, string MU)
        {
            string CART = dwEKP["PART"].ToString() + dwEKP["PVAR"].ToString();
            string CFARBE = dwEKP["PFARBE"].ToString();
            PM["CART"] = CART;
            PM["CFARBE"] = CFARBE; ;
            PM["BOX"] = BOX;
            PM["QTY"] = QTY * 0.01;
            PM["LO"] = LO;
            PM["LB"] = LB;
            PM["LP"] = LP;
            PM["MU"] = MU;
            PM["ORDERNUM"] = "  000000000 ".PadRight(12);
            DataTable TBGPD = VGPD.NEWGB04(PM);
            PARTIE = "".PadRight(8);
            if (TBGPD == null)
                return;
            if (TBGPD.Rows.Count == 0)
                return;
            foreach (DataRow row in TBGPD.Rows)
            {
                PARTIE = row["GPPARTIE"].ToString();
            }

            PM["PARTIE"] = PARTIE;
            PM["KZ"] = 0;
            PM["LO"] = TLO;
            PM["LB"] = TLB;
            PM["LP"] = TLP;
            PM["BOX"] = BOX;
            PM["QTY"] = QTY;
            TBGB = VGL.NEWMBOX(PM);
            foreach (DataRow dwGB in TBGB.Rows)
            {
                dwGB["GABAUFTYP"] = "B";
                dwGB["GABAUFKRS"] = dwEKP["EKPAUFKRS"];
                dwGB["GABAUFLFD"] = dwEKP["EKPAUFLFD"];
                dwGB["GABAUFPOS"] = dwEKP["EKPAUFPOS"];
                NWBBEW(dwGB, "11", RUNID);
            }
        }
        public void ADDEKGB(double QTY, double CONES, double TARA)
        {
            if (TBGB == null)
                return;
            DataRow dwWB = null;
            var WBS = (from DataRow row in TBGB.AsEnumerable()
                       select row["GLLBEH"].ToString())
                     .Max();
            var QWB = from DataRow row in TBGB.AsEnumerable()
                      where row["GLLBEH"].ToString() == (string)WBS
                      select row;
            foreach (DataRow row in QWB)
            {
                dwWB = row;
            }
            if (dwWB == null)
                return;
            DataRow dwBW = null;
            PARTIE = dwWB["GLPARTIE"].ToString();
            string stknr = dwWB["GLLBEH"].ToString();
            var query = from DataRow row in TBMain.AsEnumerable()
                        where row["GABLBEH"].ToString() == dwWB["GLLBEH"].ToString()
                        select row;
            foreach (DataRow row in query)
            {
                dwBW = row;
            }
            if (dwBW == null)
                return;
            DataRow dwNWB = TBGB.NewRow();
            dwNWB.ItemArray = dwWB.ItemArray;
            dwNWB["GLLBEH"] = VSDDAT.SD22.GETNEXT("0022", "AB", "GLLBEHI", 1, 10);
            dwNWB["GLLBEHI"] = dwBW["GLLBEH"];
            double BRT = System.Convert.ToDouble(dwWB["WBBSBRT"].ToString()) * 0.01 * 0.001;
            dwNWB["GLBSTNET"] = QTY * 1000;
            dwNWB["GLBSTSP"] = CONES;
            dwNWB["GLBSTKA"] = TARA * 1000;
            dwNWB["GLBSTKG"] = QTY * 1000;
            DataRow dwWBM;

            var gapos = (from DataRow row in TBMain.AsEnumerable()
                         select System.Convert.ToDouble(row["GABLFDNR"].ToString()))
                      .Max();
            LFDNR = System.Convert.ToInt32((double)gapos) + 1;
            BELEG = dwBW["GABBELEG"].ToString();
            dwWBM = TBMain.NewRow();
            dwWBM.ItemArray = dwBW.ItemArray;
            PM["ZUTEI"] = dwNWB;
            PM["BELEG"] = BELEG;
            PM["LFDNR"] = LFDNR;
            PM["RUNID"] = RUNID;
            PM["BEWBS"] = "11";
            FIXDATA(dwWBM, PM);
            TBMain.Rows.InsertAt(dwWBM, 0);
            dwWB.Table.Rows.InsertAt(dwNWB, 0);
        }
        public void CHGEKWB(string box, double QTY)
        {
            if (TBGB == null)
                return;
            DataRow dwWB = null;

            var QWB = from DataRow row in TBGB.AsEnumerable()
                      where row["GLLBEH"].ToString() == box
                      select row;
            foreach (DataRow row in QWB)
            {
                dwWB = row;
            }
            if (dwWB == null)
                return;
            DataRow dwBW = null;

            var query = from DataRow row in TBMain.AsEnumerable()
                        where row["GABLBEH"].ToString() == box
                        select row;
            foreach (DataRow row in query)
            {
                dwBW = row;
            }
            if (dwBW == null)
                return;

            double BRT = System.Convert.ToDouble(dwWB["WBBSBRT"].ToString()) * 0.01 * 0.001;
            dwWB["GABKG"] = QTY * 1000;

            LFDNR = System.Convert.ToInt32(dwBW["GABLFDNR"].ToString());
            BELEG = dwBW["GABBELEG"].ToString();

            PM["ZUTEI"] = dwWB;
            PM["BELEG"] = BELEG;
            PM["LFDNR"] = LFDNR;
            PM["RUNID"] = RUNID;
            PM["BEWBS"] = "11";
            FIXDATA(dwBW, PM);

        }

        public void FIXDATA(DataRow dwNGBW, Dictionary<string, object> pm)
        {


            DataRow dwSRC = (DataRow)pm["ZUTEI"];
            string BELEG = (string)pm["BELEG"];
            int LFDNR = (int)pm["LFDNR"];
            string BEWBS = (string)pm["BEWBS"];
            string RUNID = (string)pm["RUNID"];

            if (dwSRC == null)
                return;
            string _time = "";
            string _date = "";
            Helpers.Helper.GetTime(ref _date, ref _time);
            switch (BEWBS)
            {

                case "61":
                    #region===61=
                    dwNGBW["GABBELEG"] = BELEG;
                    dwNGBW["GABLFDNR"] = LFDNR;
                    dwNGBW["GABBS"] = "61";
                    dwNGBW["GABLO"] = dwSRC["ZULO"];
                    dwNGBW["GABLB"] = dwSRC["ZULB"];
                    dwNGBW["GABLP"] = "A       ";
                    dwNGBW["GABFC"] = "GZ18    ";
                    //msgs.MSGTYPE = "WBBS20";
                    #endregion
                    break;
                case "62":
                    #region===62=
                    dwNGBW["GABBELEG"] = BELEG;
                    dwNGBW["GABLFDNR"] = LFDNR;
                    dwNGBW["GABBS"] = "62";
                    dwNGBW["GABLO"] = dwSRC["ZULO"];
                    dwNGBW["GABLB"] = dwSRC["ZULB"];
                    dwNGBW["GABLP"] = "A       ";
                    dwNGBW["GABFC"] = "GZ18    ";
                    //msgs.MSGTYPE = "WBBS20";
                    #endregion
                    break;
                case "11":
                    #region=========
                    dwNGBW["GABBELEG"] = BELEG;
                    dwNGBW["GABLFDNR"] = LFDNR;
                    dwNGBW["GABPARTIE"] = dwSRC["GLPARTIE"];
                    dwNGBW["GABPARTIEKZ"] = dwSRC["GLPARTIEKZ"];
                    dwNGBW["GABLO"] = dwSRC["GLLO"];
                    dwNGBW["GABLB"] = dwSRC["GLLB"];
                    dwNGBW["GABLP"] = dwSRC["GLLP"];
                    dwNGBW["GABLBEH"] = dwSRC["GLLBEH"];
                    dwNGBW["GABLBEHI"] = dwSRC["GLLBEHI"];

                    dwNGBW["GABART"] = pm["ART"];
                    dwNGBW["GABVAR"] = pm["VAR"];
                    dwNGBW["GABFARBE"] = pm["FARBE"];

                    dwNGBW["GABBS"] = "11";
                    dwNGBW["GABKG"] = dwSRC["GLBSTKG"];
                    dwNGBW["GABKA"] = dwSRC["GLBSTKA"];
                    dwNGBW["GABSP"] = dwSRC["GLBSTSP"];
                    dwNGBW["GABFC"] = "EGB04   ";
                    #endregion
                    break;
                case "42":
                    #region=========
                    dwNGBW["GABBELEG"] = BELEG;
                    dwNGBW["GABLFDNR"] = LFDNR;
                    dwNGBW["GABPARTIE"] = dwSRC["GLPARTIE"];
                    dwNGBW["GABPARTIEKZ"] = dwSRC["GLPARTIEKZ"];
                    dwNGBW["GABLO"] = dwSRC["GLLO"];
                    dwNGBW["GABLB"] = dwSRC["GLLB"];
                    dwNGBW["GABLP"] = dwSRC["GLLP"];
                    dwNGBW["GABLBEH"] = dwSRC["GLLBEH"];
                    dwNGBW["GABLBEHI"] = dwSRC["GLLBEHI"];

                    dwNGBW["GABART"] = pm["ART"];
                    dwNGBW["GABVAR"] = pm["VAR"];
                    dwNGBW["GABFARBE"] = pm["FARBE"];

                    dwNGBW["GABBS"] = "42";
                    dwNGBW["GABKG"] = dwSRC["GLBSTKG"];
                    dwNGBW["GABKA"] = dwSRC["GLBSTKA"];
                    dwNGBW["GABSP"] = dwSRC["GLBSTSP"];
                    dwNGBW["GABFC"] = "EGB04   ";
                    #endregion
                    break;
                case "43":
                    #region=========
                    dwNGBW["GABBELEG"] = BELEG;
                    dwNGBW["GABLFDNR"] = LFDNR;
                    dwNGBW["GABPARTIE"] = dwSRC["GLPARTIE"];
                    dwNGBW["GABPARTIEKZ"] = dwSRC["GLPARTIEKZ"];
                    dwNGBW["GABLO"] = dwSRC["GLLO"];
                    dwNGBW["GABLB"] = dwSRC["GLLB"];
                    dwNGBW["GABLP"] = dwSRC["GLLP"];
                    dwNGBW["GABLBEH"] = dwSRC["GLLBEH"];
                    dwNGBW["GABLBEHI"] = dwSRC["GLLBEHI"];

                    dwNGBW["GABART"] = pm["ART"];
                    dwNGBW["GABVAR"] = pm["VAR"];
                    dwNGBW["GABFARBE"] = pm["FARBE"];

                    dwNGBW["GABBS"] = "43";
                    dwNGBW["GABKG"] = dwSRC["GLBSTKG"];
                    dwNGBW["GABKA"] = dwSRC["GLBSTKA"];
                    dwNGBW["GABSP"] = dwSRC["GLBSTSP"];
                    dwNGBW["GABFC"] = "EGB04   ";
                    #endregion
                    break;
                default:
                    dwNGBW["GABAUFTYP"] = pm["AUFTYP"];
                    dwNGBW["GABAUFKRS"] = pm["KRS"];
                    dwNGBW["GABAUFLFD"] = pm["LFD"];
                    dwNGBW["GABAUFPOS"] = pm["POS"];
                    dwNGBW["GABAFOLGE"] = pm["FOLGE"];
                    break;
            }

            dwNGBW["GABWERTDAT"] = _date;
            dwNGBW["GABBUCHDAT"] = _date;
            dwNGBW["GABBUCHZEIT"] = _time;
            dwNGBW["GABBUCHBEN"] = app.User;

            switch (BEWBS)
            {
                case "61":
                case "62":
                    #region=========
                    dwNGBW["GABJJJJ"] = year;
                    dwNGBW["GABPARTIE"] = dwSRC["ZUPARTIE"];
                    dwNGBW["GABPARTIEKZ"] = dwSRC["ZUPARTIEKZ"];
                    dwNGBW["GABLBEH"] = dwSRC["ZULBEHI"];
                    dwNGBW["GABLBEHI"] = dwSRC["ZULBEHI"];
                    dwNGBW["GABART"] = dwSRC["ZUART"];
                    dwNGBW["GABVAR"] = dwSRC["ZUVAR"];
                    dwNGBW["GABFARBE"] = dwSRC["ZUFARBE"];
                    dwNGBW["GABAUFTYP"] = "V";
                    dwNGBW["GABAUFKRS"] = dwSRC["ZUAUFKRS"];
                    dwNGBW["GABAUFLFD"] = dwSRC["ZUAUFLFD"];
                    dwNGBW["GABAUFPOS"] = dwSRC["ZUAUFPOS"];
                    dwNGBW["GABAFOLGE"] = "000";
                    dwNGBW["GABTEILNR"] = dwSRC["ZUTEILNR"];
                    dwNGBW["GABSA"] = dwSRC["ZUSA"];
                    dwNGBW["GABPOS"] = dwSRC["ZUPOS"];
                    dwNGBW["GABKG"] = dwSRC["ZUEINTKG"];
                    #endregion
                    break;
                default:

                    break;
            }

        }

        public void POSTBATCH(Dictionary<string, object> pm)
        {
            DataTable TBMOV = pm["TBGB14"] as DataTable;
            if (TBMOV == null)
                return;
            if (TBGB == null)
                return;
            string lot = pm["PARTIE"].ToString();

            string kz = pm["KZ"].ToString();
            dwData = VGL.TBMain.NewRow();
            dwData["GLMANDANT"] = app.Mandant;
            dwData["GLPARTIE"] = lot;
            dwData["GLPARTIEKZ"] = kz;
            VGL.DGLLG01(dwData); //删除当前卡号下的所有行 

            foreach (DataRow dwWBM in TBMOV.Rows)
            {
                string stknr = dwWBM["GLLBEHI"].ToString();
                filter = "GLLBEHI='" + stknr + "'";
                rows = TBGB.Select(filter);
                foreach (DataRow dwWB in rows)
                {
                    double GABKG = 0.001 * System.Convert.ToDouble(dwWBM["GABKG"].ToString());
                    double GABSP = System.Convert.ToDouble(dwWBM["GABSP"].ToString());
                    dwWB["GLBSTNET"] = GABKG;
                    dwWB["GLBSTSP"] = GABSP;
                }
            }

            dwData = TBMain.NewRow();
            dwData["GABMANDANT"] = app.Mandant;
            dwData["GABPARTIE"] = lot;
            dwData["GABPARTIEKZ"] = kz;
            //DeleteICC_WBBEW(dwData, 2);//暂时保留，说明还没最终确认
            DBW01(dwData);
            filter = "GABPARTIE='" + lot + "' AND GABPARTIEKZ='" + kz + "'";
            rows = TBMOV.Select(filter);
            foreach (DataRow dwWBM in rows)
            {
                BATCHWB14(dwWBM);
            }
            POSTCHG();
            PM["TBGB"] = TBGB;
            PM["ORDERNUM"] = pm["ORDERNUM"];
            PM["AUFTYP"] = pm["AUFTYP"];
            PM["KRS"] = pm["KRS"];
            PM["LFD"] = pm["LFD"];
            PM["POS"] = pm["POS"];
            VGL.GB15BATCH(PM);
        }
    }

    public partial class VGABEW
    {
        public double GABBELEG { get { if (dwMaster == null) return 0.0; return Convert.ToDouble(dwMaster["GABBELEG"].ToString()); } set { if (dwMaster == null) return; dwMaster["GABBELEG"] = value; OnPropertyChanged("GABBELEG", value); } } //lENGth 0
        public double GABBUCHDAT { get { if (dwMaster == null) return 0.0; return Convert.ToDouble(dwMaster["GABBUCHDAT"].ToString()); } set { if (dwMaster == null) return; dwMaster["GABBUCHDAT"] = value; OnPropertyChanged("GABBUCHDAT", value); } } //lENGth 0
        public double GABBUCHZEIT { get { if (dwMaster == null) return 0.0; return Convert.ToDouble(dwMaster["GABBUCHZEIT"].ToString()); } set { if (dwMaster == null) return; dwMaster["GABBUCHZEIT"] = value; OnPropertyChanged("GABBUCHZEIT", value); } } //lENGth 0

        #region======ColumnSchema==========
        /*
                 public string GABMANDANT { get { if (dwMaster == null) return ""; return dwMaster["GABMANDANT"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABMANDANT"] = value; OnPropertyChanged("GABMANDANT", value); } } //lENGth 2
                 public double GABJJJJ { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["GABJJJJ"].ToString()); } set { if (dwMaster == null) return; dwMaster["GABJJJJ"] = value; OnPropertyChanged("GABJJJJ", value); } } //lENGth 0
                 public double GABLFDNR { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["GABLFDNR"].ToString()); } set { if (dwMaster == null) return; dwMaster["GABLFDNR"] = value; OnPropertyChanged("GABLFDNR", value); } } //lENGth 0
                 public string GABPARTIE { get { if (dwMaster == null) return ""; return dwMaster["GABPARTIE"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABPARTIE"] = value; OnPropertyChanged("GABPARTIE", value); } } //lENGth 7
                 public string GABPARTIEKZ { get { if (dwMaster == null) return ""; return dwMaster["GABPARTIEKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABPARTIEKZ"] = value; OnPropertyChanged("GABPARTIEKZ", value); } } //lENGth 1
                 public string GABSPSTA { get { if (dwMaster == null) return ""; return dwMaster["GABSPSTA"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABSPSTA"] = value; OnPropertyChanged("GABSPSTA", value); } } //lENGth 2
                 public string GABZENSUR { get { if (dwMaster == null) return ""; return dwMaster["GABZENSUR"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABZENSUR"] = value; OnPropertyChanged("GABZENSUR", value); } } //lENGth 1
                 public string GABLO { get { if (dwMaster == null) return ""; return dwMaster["GABLO"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABLO"] = value; OnPropertyChanged("GABLO", value); } } //lENGth 2
                 public string GABLB { get { if (dwMaster == null) return ""; return dwMaster["GABLB"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABLB"] = value; OnPropertyChanged("GABLB", value); } } //lENGth 2
                 public string GABLP { get { if (dwMaster == null) return ""; return dwMaster["GABLP"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABLP"] = value; OnPropertyChanged("GABLP", value); } } //lENGth 8
                 public string GABAUFBKZ { get { if (dwMaster == null) return ""; return dwMaster["GABAUFBKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABAUFBKZ"] = value; OnPropertyChanged("GABAUFBKZ", value); } } //lENGth 1
                 public string GABLBEH { get { if (dwMaster == null) return ""; return dwMaster["GABLBEH"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABLBEH"] = value; OnPropertyChanged("GABLBEH", value); } } //lENGth 10
                 public string GABLBEHI { get { if (dwMaster == null) return ""; return dwMaster["GABLBEHI"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABLBEHI"] = value; OnPropertyChanged("GABLBEHI", value); } } //lENGth 10
                 public string GABART { get { if (dwMaster == null) return ""; return dwMaster["GABART"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABART"] = value; OnPropertyChanged("GABART", value); } } //lENGth 20
                 public string GABVAR { get { if (dwMaster == null) return ""; return dwMaster["GABVAR"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABVAR"] = value; OnPropertyChanged("GABVAR", value); } } //lENGth 3
                 public string GABFARBE { get { if (dwMaster == null) return ""; return dwMaster["GABFARBE"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABFARBE"] = value; OnPropertyChanged("GABFARBE", value); } } //lENGth 10
                 public string GABDEZI { get { if (dwMaster == null) return ""; return dwMaster["GABDEZI"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABDEZI"] = value; OnPropertyChanged("GABDEZI", value); } } //lENGth 1
                 public string GABAUFTYP { get { if (dwMaster == null) return ""; return dwMaster["GABAUFTYP"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABAUFTYP"] = value; OnPropertyChanged("GABAUFTYP", value); } } //lENGth 1
                 public string GABAUFKRS { get { if (dwMaster == null) return ""; return dwMaster["GABAUFKRS"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABAUFKRS"] = value; OnPropertyChanged("GABAUFKRS", value); } } //lENGth 2
                 public string GABAUFLFD { get { if (dwMaster == null) return ""; return dwMaster["GABAUFLFD"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABAUFLFD"] = value; OnPropertyChanged("GABAUFLFD", value); } } //lENGth 6
                 public string GABAUFPOS { get { if (dwMaster == null) return ""; return dwMaster["GABAUFPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABAUFPOS"] = value; OnPropertyChanged("GABAUFPOS", value); } } //lENGth 3
                 public string GABAFOLGE { get { if (dwMaster == null) return ""; return dwMaster["GABAFOLGE"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABAFOLGE"] = value; OnPropertyChanged("GABAFOLGE", value); } } //lENGth 3
                 public string GABTEILNR { get { if (dwMaster == null) return ""; return dwMaster["GABTEILNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABTEILNR"] = value; OnPropertyChanged("GABTEILNR", value); } } //lENGth 4
                 public string GABSA { get { if (dwMaster == null) return ""; return dwMaster["GABSA"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABSA"] = value; OnPropertyChanged("GABSA", value); } } //lENGth 3
                 public string GABPOS { get { if (dwMaster == null) return ""; return dwMaster["GABPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABPOS"] = value; OnPropertyChanged("GABPOS", value); } } //lENGth 2
                 public string GABKSTKRS { get { if (dwMaster == null) return ""; return dwMaster["GABKSTKRS"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABKSTKRS"] = value; OnPropertyChanged("GABKSTKRS", value); } } //lENGth 2
                 public string GABKST { get { if (dwMaster == null) return ""; return dwMaster["GABKST"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABKST"] = value; OnPropertyChanged("GABKST", value); } } //lENGth 4
                 public string GABKOSTART { get { if (dwMaster == null) return ""; return dwMaster["GABKOSTART"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABKOSTART"] = value; OnPropertyChanged("GABKOSTART", value); } } //lENGth 6
                 public string GABBS { get { if (dwMaster == null) return ""; return dwMaster["GABBS"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABBS"] = value; OnPropertyChanged("GABBS", value); } } //lENGth 2
                 public double GABWERTDAT { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["GABWERTDAT"].ToString()); } set { if (dwMaster == null) return; dwMaster["GABWERTDAT"] = value; OnPropertyChanged("GABWERTDAT", value); } } //lENGth 0
                 public double GABKG { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["GABKG"].ToString()); } set { if (dwMaster == null) return; dwMaster["GABKG"] = value; OnPropertyChanged("GABKG", value); } } //lENGth 0
                 public double GABKA { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["GABKA"].ToString()); } set { if (dwMaster == null) return; dwMaster["GABKA"] = value; OnPropertyChanged("GABKA", value); } } //lENGth 0
                 public double GABSP { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["GABSP"].ToString()); } set { if (dwMaster == null) return; dwMaster["GABSP"] = value; OnPropertyChanged("GABSP", value); } } //lENGth 0
                 public double GABWERT { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["GABWERT"].ToString()); } set { if (dwMaster == null) return; dwMaster["GABWERT"] = value; OnPropertyChanged("GABWERT", value); } } //lENGth 0
                 public string GABWEKORR { get { if (dwMaster == null) return ""; return dwMaster["GABWEKORR"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABWEKORR"] = value; OnPropertyChanged("GABWEKORR", value); } } //lENGth 2
                 public string GABBUCHBEN { get { if (dwMaster == null) return ""; return dwMaster["GABBUCHBEN"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABBUCHBEN"] = value; OnPropertyChanged("GABBUCHBEN", value); } } //lENGth 8
                 public string GABFC { get { if (dwMaster == null) return ""; return dwMaster["GABFC"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABFC"] = value; OnPropertyChanged("GABFC", value); } } //lENGth 8
                 public double GABKONDAT { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["GABKONDAT"].ToString()); } set { if (dwMaster == null) return; dwMaster["GABKONDAT"] = value; OnPropertyChanged("GABKONDAT", value); } } //lENGth 0
                 public string GABMATABR { get { if (dwMaster == null) return ""; return dwMaster["GABMATABR"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABMATABR"] = value; OnPropertyChanged("GABMATABR", value); } } //lENGth 1
                 public string GABSTORKZ { get { if (dwMaster == null) return ""; return dwMaster["GABSTORKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABSTORKZ"] = value; OnPropertyChanged("GABSTORKZ", value); } } //lENGth 1
                 public double GABINVBLG { get { if (dwMaster == null) return 0.0; return  Convert.ToDouble(dwMaster["GABINVBLG"].ToString()); } set { if (dwMaster == null) return; dwMaster["GABINVBLG"] = value; OnPropertyChanged("GABINVBLG", value); } } //lENGth 0
                 public string GABDISPOKZ { get { if (dwMaster == null) return ""; return dwMaster["GABDISPOKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABDISPOKZ"] = value; OnPropertyChanged("GABDISPOKZ", value); } } //lENGth 1
                 public string GABAPOS { get { if (dwMaster == null) return ""; return dwMaster["GABAPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABAPOS"] = value; OnPropertyChanged("GABAPOS", value); } } //lENGth 4
                 public string GABACTION { get { if (dwMaster == null) return ""; return dwMaster["GABACTION"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABACTION"] = value; OnPropertyChanged("GABACTION", value); } } //lENGth 2
                 public string GABIKOND { get { if (dwMaster == null) return ""; return dwMaster["GABIKOND"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABIKOND"] = value; OnPropertyChanged("GABIKOND", value); } } //lENGth 4
                 public string GABCARRIER { get { if (dwMaster == null) return ""; return dwMaster["GABCARRIER"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABCARRIER"] = value; OnPropertyChanged("GABCARRIER", value); } } //lENGth 8
                 public string GABCARRPOS { get { if (dwMaster == null) return ""; return dwMaster["GABCARRPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABCARRPOS"] = value; OnPropertyChanged("GABCARRPOS", value); } } //lENGth 3
                 public string GABMNRKRS { get { if (dwMaster == null) return ""; return dwMaster["GABMNRKRS"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABMNRKRS"] = value; OnPropertyChanged("GABMNRKRS", value); } } //lENGth 2
                 public string GABMLFDNR { get { if (dwMaster == null) return ""; return dwMaster["GABMLFDNR"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABMLFDNR"] = value; OnPropertyChanged("GABMLFDNR", value); } } //lENGth 4
                 public string GABMPOS { get { if (dwMaster == null) return ""; return dwMaster["GABMPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABMPOS"] = value; OnPropertyChanged("GABMPOS", value); } } //lENGth 2
                 public string GABSCHICHT { get { if (dwMaster == null) return ""; return dwMaster["GABSCHICHT"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABSCHICHT"] = value; OnPropertyChanged("GABSCHICHT", value); } } //lENGth 1
                 public string GABFILLER { get { if (dwMaster == null) return ""; return dwMaster["GABFILLER"].ToString(); } set { if (dwMaster == null) return; dwMaster["GABFILLER"] = value; OnPropertyChanged("GABFILLER", value); } } //lENGth 39
        */
        #endregion
    }
}
